package com.xinqing.test.modle;


/**
 * @author: CHQ
 * @create: 2020-03-13 09:59
 * @description: todo
 **/


public class CommonResponse {
    private Object rslt;
    private String msg;
    private int code;

    enum Code {
        SUCCESS(0),
        FAILED(-1);

        private int code;

        Code(int code) {
            this.code = code;

        }

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

    }

    static CommonResponse build(int code, String msg, Object rslt) {
        CommonResponse rsp = new CommonResponse();
        rsp.setCode(code);
        rsp.setMsg(msg);
        rsp.setRslt(rslt);
        return rsp;
    }

    public Object getRslt() {
        return rslt;
    }

    public void setRslt(Object rslt) {
        this.rslt = rslt;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
